import { _decorator, Component, Label, Node } from 'cc';
import { GameStorage, StorageKey } from './Global';
import { GameData } from './GameData';
const { ccclass, property } = _decorator;

@ccclass('LevelLabel')
export class LevelLabel extends Component {
    start() {
        this.restart();
    }

    update(deltaTime: number) {

    }

    restart() {
        const level = GameStorage.getItem(StorageKey.LEVEL);
        const label = this.node.getComponent(Label);
        label.string = `第${level}/${GameData.getAllLevel()}关`;
    }
}


